<template>
	<view class="page">
		<view class="list">
			<view class="item" v-for="item in list" :key="item.id">
				<view class="row">
					<view class="col">
						设备类型：{{item.tool_type || '接地棒'}} 
					</view>
					<view class="col">
						线路名称：{{item.line_name || 'XXX'}} 
					</view>
				</view>
				<view class="row">
					<view class="col">
						告警原因：{{item.warn_info || '电池电压不足'}} 
					</view>
					<view class="col">
						告警类型：{{item.work_content || '风险告警'}} 
					</view>
				</view>
				<view class="row">
					<view class="col">
						接地组号：{{item.group_no || 'xxxxx'}} 
					</view>
					<view class="col">
						具体编号：{{item.position || 'XXXX'}} 
					</view>
				</view>
				<view class="row">
					告警时间： {{item.warn_time || '2019/10/21 10：35'}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
import api from '../../consts/api.js'
export default {
	data() {
		return {
			list: [
				{
					id: 1,
					tool_type: '',
					line_name: '',
					warn_info: '',
					work_content: '',
					group_no: '',
					position: '',
					warn_time: ''
				},
				{
					id: 2,
					tool_type: '',
					line_name: '',
					warn_info: '',
					work_content: '',
					group_no: '',
					position: '',
					warn_time: ''
				},
				{
					id: 3,
					tool_type: '',
					line_name: '',
					warn_info: '',
					work_content: '',
					group_no: '',
					position: '',
					warn_time: ''
				},
				{
					id: 4,
					tool_type: '',
					line_name: '',
					warn_info: '',
					work_content: '',
					group_no: '',
					position: '',
					warn_time: ''
				},
				{
					id: 5,
					tool_type: '',
					line_name: '',
					warn_info: '',
					work_content: '',
					group_no: '',
					position: '',
					warn_time: ''
				},
				{
					id: 6,
					tool_type: '',
					line_name: '',
					warn_info: '',
					work_content: '',
					group_no: '',
					position: '',
					warn_time: ''
				}
			],
		}
	},
	methods: {
		async warnInfo() {
			let res = await this.$fetch('GET',api.warnInfo,{
				org_code: '0001',
				offset: 1,
				limit: 100
			})
			let {code, data} = res.data
			this.list = data
		}
	},
	onLoad() {
		// this.warnInfo()
	}
}
</script>

<style>
.list {
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	bottom: 0;
	width: 750upx;
	background: #FFFFFF;
	overflow-y: auto;
}
.item {
	padding-top: 40upx;
	height: 200upx;
	border-bottom: 1upx solid #4D4D4D;	
}
.row {
	display: flex;
	margin: 20upx;
	font-size: 20upx;
	color: #808080;
}
.col {
	width: 50%;
	text-align: left;
}
</style>
